using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Barebones.Components;
using Barebones.Dependencies;

namespace Meat.Rendering
{
    public class RenderSettings : EntityComponent
    {
        public bool Lighting
        { get; set; }

        public bool Hidden
        { get; set; }

        public BlendState BlendState
        { get; set; }

        public RasterizerState RasterizerState
        { get; set; }

        public SamplerState Sampler
        { get; set; }

        public RenderSettings()
        {
            BlendState = BlendState.AlphaBlend;
            RasterizerState = RasterizerState.CullNone;

            Sampler = SamplerState.LinearClamp;
        }

        public override IEnumerable<IDependency> GetDependencies()
        {
            yield break;
        }

        public void Apply(BasicEffect effect)
        {
            if (Lighting)
            {
                effect.EnableDefaultLighting();
            }
            else
            {
                effect.LightingEnabled = false;
            }
        }
    }
}
